/**
 * @file    WebOleInPlaceSite.h
 * @brief   
 * @date    2005-03-15 15:55:23
 * @author  GengYong (gengyong@gmail.com)
 *
 */

#ifndef WEBWINDOW_HEADER_WEBOLEINPLACESITE_H
#define WEBWINDOW_HEADER_WEBOLEINPLACESITE_H
//----------------------------------------------------------

#include "WebWindowImpl.h"
#include "WebOleInPlaceUIWindow.h"
#include "WebOleInPlaceFrame.h"

namespace xessage_private {
	class WebOleInPlaceSite: public IOleInPlaceSite
	{
	public:
		WebOleInPlaceSite(WebWindowImpl * app);
		virtual ~WebOleInPlaceSite();
	public:
		virtual	HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject);
		virtual ULONG	STDMETHODCALLTYPE AddRef();
		virtual ULONG	STDMETHODCALLTYPE Release();
		virtual	HRESULT STDMETHODCALLTYPE GetWindow(HWND * lphwnd);
		virtual	HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
		virtual	HRESULT STDMETHODCALLTYPE CanInPlaceActivate();
		virtual	HRESULT STDMETHODCALLTYPE OnInPlaceActivate();
		virtual	HRESULT STDMETHODCALLTYPE OnUIActivate();
		virtual	HRESULT STDMETHODCALLTYPE GetWindowContext(LPOLEINPLACEFRAME * lplpFrame, LPOLEINPLACEUIWINDOW * lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo);
		virtual	HRESULT STDMETHODCALLTYPE Scroll(SIZE scrollExtent);
		virtual	HRESULT STDMETHODCALLTYPE OnUIDeactivate(BOOL fUndoable);
		virtual	HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate();
		virtual	HRESULT STDMETHODCALLTYPE DiscardUndoState();
		virtual	HRESULT STDMETHODCALLTYPE DeactivateAndUndo();
		virtual	HRESULT STDMETHODCALLTYPE OnPosRectChange(LPCRECT lprcPosRect);
	protected:
		virtual HRESULT STDMETHODCALLTYPE OnBuildAccelerator(HACCEL * lpaccel, UINT * lpEntries);
	private:
		WebWindowImpl *			m_appImpl;
		WebOleInPlaceUIWindow *	m_inPlaceUIWindow;
		WebOleInPlaceFrame *	m_inPlaceFrame;
		HACCEL					m_accel;
		UINT					m_entries;
		LONG					m_refCount;
	};
}

//----------------------------------------------------------
#endif	//ifndef WEBWINDOW_HEADER_WEBOLEINPLACESITE_H